package com.softeem.hbsm_video.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.softeem.hbsm_video.entity.Video;
import com.softeem.hbsm_video.service.VideoService;
import com.softeem.hbsm_video.mapper.VideoMapper;
import org.springframework.stereotype.Service;


/**
* @author zhouyu
* @description 针对表【video(视频表)】的数据库操作Service实现
* @createDate 2024-07-01 15:17:20
*/
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video>
    implements VideoService{

    @Override
    public Video findByTitle(String title) {
        return baseMapper.selectOne(new LambdaQueryWrapper<Video>()
                .eq(Video::getTitle, title));
    }


    @Override
    public boolean updateByTitle(Video byTitle) {
        if (baseMapper.update(byTitle, new LambdaQueryWrapper<Video>()
                .eq(Video::getTitle, byTitle.getTitle())) > 0) {
            return true;
        }
        return false;
    }
}




